var vm = new Vue({
    //vue对象节点,指向父盒子
    el:'#indexVm',                                                                   
    //vue实例 的data属性
    data:function(){
        return{
        	bodyH:'',
        	bodyW:'',
        	userName:'admin',
            isCollapse: true,
            user:{}
        };
    },
    //vue实例 的methods
    methods:{
        exit:function(){
            vm.$confirm('确定退出?','提示',{
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type:'warning',
                callback:function(e){
                    if(e === 'confirm'){
                        pb.ajaxPost("./logout.action",vm.userName,function(res){
                            if(res.code == '000000'){
                                window.top.location.href="./login.html"
                            }else{
                            	pb.alertErr('注销失败');
                            }
                        });
                    	//window.top.location.href="login.html"
                    }
                }
            });
        },
        goTo:function(name,tid){
        	$('#iframe').attr('src',name+".jsp?id="+tid);
        },
        loadData:function(){
        	vm.goTo('main');
        	var userCode = pb.getQueryString('userCode');
        	var url = "";
        	var params = {
        		'userCode' : userCode
        	}
        	pb.ajaxPost(url,params,function(r){
        		
        	},function(err){

        	});
        },
        //样式控制
        getCss:function(){
        	
        	vm.bodyH = document.body.clientHeight;
        	vm.bodyW = document.body.clientWidth;
        	$('#menu').css("height",vm.bodyH-80);
        	$('#iframe').css("height",vm.bodyH-80-10);
        }
    }
    //vue实例 的methods结束
});
vm.getCss();